package com.example.demo.mapper;

import com.example.demo.entity.basicdata;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface basicdataMapper<String>{
    @Select("select * from view_basicdata where wfkey=#{wfkey} and ukey=#{ukey}")
    public basicdata SelectWfkeyUkey(int wfkey,String ukey);

    @Insert("insert into view_basicdata(wfkey,wfname,unum,ukey,manufacturer,model,indate,slife,estatus," +
            "insite,upower,tpower) value(#{wfkey},#{wfname},#{unum},#{ukey},#{manufacturer},#{model}," +
            "#{indate},#{slife},#{estatus},#{insite},#{upower},#{tpower})")
    public int insert(basicdata basicdata);

    @Select("select * from view_basicdata")
    public List<basicdata> query();

    @Delete("delete from view_basicdata where wfkey=#{wfkey} and ukey=#{ukey}")
    public int delete(int wfkey,String ukey);

    @Update("update view_basicdata set wfname=#{wfname},unum=#{unum}," +
            "manufacturer=#{manufacturer},model=#{model},indate=#{indate},slife=#{slife}," +
            "estatus=#{estatus},insite=#{insite},upower=#{upower},tpower=#{tpower} " +
            "where wfkey=#{wfkey} and ukey=#{ukey}")
    public int update(basicdata basicdata);
}
